package com.molichuxing.gateway.property;

/**
 * 
 * @author liyg 出入库类型枚举类
 *
 */
public enum StockRecordTypeEnum {

	/**
	 *采购入库
	 */
	PURCHASE_IN_STOCK (1, "采购入库"),
	
	/**
	 *调拨入库
	 */
	ALLOT_IN_STOCK (2, "调拨入库"),
	
	/**
	 *调拨出库
	 */
	ALLOT_OUT_STOCK (3, "调拨出库"),
	
	/**
	 *调拨入店
	 */
	ALLOT_IN_STORE (4, "调拨入店"),
	
	/**
	 *拒收入库
	 */
	REJECTION_IN_STOCK (5, "拒收入库"),
	
	/**
	 *收车入库
	 */
	COLLECT_IN_STOCK (6, "还车入库"),
	
	/**
	 * 采购入店
	 */
	PURCHASE_IN_STORE(7,"采购入店");
	
	

	
	int value;
	String name;

	StockRecordTypeEnum(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}


	/**
	 * 通过value获取枚举的name
	 * 
	 * @param value
	 * @return
	 */
	public static String getName(int value) {
		StockRecordTypeEnum enumerate = getEnum(value);
		return enumerate == null ? null : enumerate.getName();
	}

	/**
	 * 通过value获取枚举
	 * 
	 * @param value
	 * @return
	 */
	public static StockRecordTypeEnum getEnum(int value) {
		for (StockRecordTypeEnum enumerate : StockRecordTypeEnum.values()) {
			if (enumerate.getValue() == value) {
				return enumerate;
			}
		}
		return null;
	}
}
